package com.ruoyi.house.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house.mapper.YjzFavoriteMapper;
import com.ruoyi.house.domain.YjzFavorite;
import com.ruoyi.house.service.IYjzFavoriteService;

/**
 * 收藏Service业务层处理
 *
 * @author 码道可道
 * @date 2025-07-14
 */
@Service
public class YjzFavoriteServiceImpl extends ServiceImpl<YjzFavoriteMapper, YjzFavorite> implements IYjzFavoriteService {
    @Autowired
    private YjzFavoriteMapper yjzFavoriteMapper;

    /**
     * 查询收藏
     *
     * @param id 收藏主键
     * @return 收藏
     */
    @Override
    public YjzFavorite selectYjzFavoriteById(Long id) {
        return yjzFavoriteMapper.selectYjzFavoriteById(id);
    }

    /**
     * 查询收藏列表
     *
     * @param yjzFavorite 收藏
     * @return 收藏
     */
    @Override
    public List<YjzFavorite> selectYjzFavoriteList(YjzFavorite yjzFavorite) {
        return yjzFavoriteMapper.selectYjzFavoriteList(yjzFavorite);
    }

    /**
     * 新增收藏
     *
     * @param yjzFavorite 收藏
     * @return 结果
     */
    @Override
    public int insertYjzFavorite(YjzFavorite yjzFavorite) {
                yjzFavorite.setCreateTime(DateUtils.getNowDate());
            return yjzFavoriteMapper.insertYjzFavorite(yjzFavorite);
    }

    /**
     * 修改收藏
     *
     * @param yjzFavorite 收藏
     * @return 结果
     */
    @Override
    public int updateYjzFavorite(YjzFavorite yjzFavorite) {
        return yjzFavoriteMapper.updateYjzFavorite(yjzFavorite);
    }

    /**
     * 批量删除收藏
     *
     * @param ids 需要删除的收藏主键
     * @return 结果
     */
    @Override
    public int deleteYjzFavoriteByIds(Long[] ids) {
        return yjzFavoriteMapper.deleteYjzFavoriteByIds(ids);
    }

    /**
     * 删除收藏信息
     *
     * @param id 收藏主键
     * @return 结果
     */
    @Override
    public int deleteYjzFavoriteById(Long id) {
        return yjzFavoriteMapper.deleteYjzFavoriteById(id);
    }
}